import javax.imageio.stream.ImageOutputStream;
import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) {
        int price = 0;
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入机票的原价：");
        int originalPrice = sc.nextInt();
        System.out.print("请输入月份：");
        int month = sc.nextInt();
        System.out.print("请输入座位类型（0为头等舱，1为经济舱）：");
        int seatType = sc.nextInt();
        if (month >= 5 && month <= 10) {
            price = getPrice(originalPrice,seatType,0.95,0.85);
        }else if((month >=1 && month <= 4) || (month >=11 && month <=12)){
            price = getPrice(originalPrice,seatType,0.75,0.65);
        }else {
            System.out.println("非法月份");
        }
        System.out.println("价格为：" + price);
    }

    public static int getPrice(int originalPrice,int seatType,double discount1 ,double discount2){
        if (seatType == 0) {
            originalPrice = (int)(originalPrice * discount1);
        }else if (seatType == 1){
            originalPrice = (int)(originalPrice * discount2);
        }else {
            System.out.println("没有这个仓位");
        }
        return originalPrice;
    }
}
